# 添加异常检测代码
import json

from flask import Flask, request, jsonify
from xhs_by_day import *
app = Flask(__name__)


@app.route('/process', methods=['GET','POST'])
def process_data():


    if request.method == 'POST':
        # for i in data:
        #     print(i["port"])
        # result_data.update({"code": 200, "msg": result_data[0], "method": "POST"})
        result_data = read_xhs_spider_config()
        print(result_data)
        return result_data


    else:
        res_da = read_xhs_spider_config()
        return res_da


if __name__ == '__main__':

    app.run(host='0.0.0.0',port=5006,threaded=True)